#pragma once
#include "../shared/shared_types.h" // for Vec3f

#include <vector>
#include <string>

namespace Putin{

/**
 * \brief The Base object that occurs in the game
 * Pretty much anything with an ID and position..
 */
class GameObject
{
public:
	GameObject(void);
	virtual ~GameObject(void);
	friend class RenderableUnitImpl;

	/*!
	 * \brief Get the ID 
	 * \returns the ID of the object
	 */
	int	 getID(){return mId;}

	virtual Vec3f& getPosition(){return mPos;}
	virtual Vec3f& getFacingDirection(){return mFacingDirection;}
	virtual Vec3f& getChildFacingDirection(){return mChildFacingDirection;}
	virtual Vec3f& getUpVector(){return mUpVector;}
	virtual std::string getMesh(){return mMesh;}
	virtual std::string getMaterial(){return mMaterial;}
	virtual std::string getChildMesh(){return mChildMesh;}
	virtual std::string getChildMaterial(){return mChildMaterial;}
	virtual float getScale(){return mScale;}

	virtual void setPosition(Vec3f& pos){mPos = pos;}
	virtual void setUpVector(Vec3f& vec){mUpVector = vec;}
	virtual void setFacingDirection(Vec3f& dir){mFacingDirection = dir;}
	virtual void setChildFacingDirection(Vec3f& dir){mChildFacingDirection = dir;}
	virtual void setScale(float s){mScale = s;}

	// TODO: remove
	virtual void pushEffect(std::string effect);
	virtual void removeEffect(std::string effect);
	// --  

	virtual void addEffect(std::string effect){ this->mEffectsToBeAdded.push_back(effect); }
	virtual void dropEffect(std::string effect){this->mEffectsToBeDropped.push_back(effect);}
	virtual void addChildEffect(std::string effect){ this->mChildEffectsToBeAdded.push_back(effect); }
	virtual void dropChildEffect(std::string effect){this->mChildEffectsToBeDropped.push_back(effect);}
	virtual void clearEffectQueues()
	{
		mEffectsToBeAdded.clear(); 
		mEffectsToBeDropped.clear();
		mChildEffectsToBeAdded.clear();
		mChildEffectsToBeDropped.clear();
	}



//protected:

	int		mId;	
	Vec3f	mPos;
	Vec3f	mFacingDirection;
	Vec3f	mChildFacingDirection;
	float	mChildRotation;
    Vec3f	mUpVector;
	float	mScale;
	bool	mShadow;

	//material script files and meshes are parsed from the resources folder
	//and passed as strings to Ogre when they are supposed to be used
	std::string mMaterial;
	std::string mMesh;

	// Tower
	std::string mChildMesh;
	std::string mChildMaterial;

	std::vector<std::string> mEffectList; // TODO: REMOVe
	std::vector<std::string> mEffectsToBeAdded;
	std::vector<std::string> mEffectsToBeDropped;
	std::vector<std::string> mChildEffectsToBeAdded;
	std::vector<std::string> mChildEffectsToBeDropped;

};

} // End namespace Putin